<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>

<!DOCTYPE html>
<html>
<head>
	<title>阿玛尼护肤造型</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta name="format-detection" content="telephone=no">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0,user-scalable=no">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<link rel="stylesheet" type="text/css" media="screen" href="${ROOT_PATH}content/scripts/bootstrap/css/bootstrap.min.css">
	<link rel="stylesheet" type="text/css" media="screen" href="${ROOT_PATH}content/css/ratchet.min.css?v=1.7">
	<link rel="stylesheet" type="text/css" media="screen" href="${ROOT_PATH}content/css/storefront.css">
	<script src="${ROOT_PATH}content/scripts/jquery-1.10.1.min.js"></script>
	<script src="${ROOT_PATH}content/scripts/juery.hammer.js"></script>
	<script src="${ROOT_PATH}content/scripts/bootstrap/js/bootstrap.min.js"></script>
	<script src="${ROOT_PATH}content/scripts/artDialog/jquery.artDialog.js?skin=aero"></script>
	<script src="${ROOT_PATH}content/scripts/artDialog/artDialog.iframeTools.js"></script>
	<script src="${ROOT_PATH}content/scripts/public.js"></script>
	<style type="text/css">
		input[type=password],input[type=text]{background-color: transparent;width: 80%;border-radius: 0px;}
		#getcode{
			background:url(${ROOT_PATH }content/images/front/amani1_07.png) no-repeat;background-size: 100% 100%;
		}
	</style>
</head>
<body>
	<section>
		<div class="container-fluid" style="color: white;">
			<div class="row text-center" style="margin: 25px 0;">
				<img alt="..." src="${memberImageUrl}" onerror="this.src='${ROOT_PATH}content/images/p1_head.jpg'" style="width: 30%;" class="img-circle">
			</div>
			<div class="row" style="margin-top: 60px;">
				<div class="col-xs-4 text-right">姓名</div>
				<div class="col-xs-8">${membername}</div>
			</div>
			<div class="row" style="margin-top: 20px;">
				<div class="col-xs-4 text-right">手机</div>
				<div class="col-xs-8">${memberphone}</div>
			</div>
			<div class="row" style="margin-top: 20px;">
				<div class="col-xs-4 text-right">生日</div>
				<div class="col-xs-8">${memberbirthday}</div>
			</div>
			<div class="row" style="margin-top: 20px;">
				<div class="col-xs-4 text-right">身份证</div>
				<div class="col-xs-8">${memberpcid}</div>
			</div>
			<div class="row" style="margin: 30px -10px -5px -10px;background-color: #303030;padding: 10px 0;">
				<div class="col-xs-12 text-left">修改密码</div>
			</div>
			<div class="row" style="margin: 30px -10px -5px -10px;background-color: #303030;padding: 10px 0;">
				<div class="row">
					<div class="col-xs-3 text-right">旧密码</div>
					<div class="col-xs-9"><input type="password" id="pwd" name="pwd"  placeholder="请输入旧密码" /></div>
				</div>
				<div class="row">
					<div class="col-xs-3 text-right">新密码</div>
					<div class="col-xs-9"><input type="password" id="npwd" name="npwd" placeholder="请输入新密码" /></div>
				</div>
				<div class="row">
					<div class="col-xs-3 text-right">验证码</div>
					<div class="col-xs-4"><input type="text" id="checkcode" name="checkcode" style="width: 120px;" placeholder="动态验证码" /></div>
					<div class="col-xs-5" style="line-height: 50px;"><input name="getcode" type="button" id="getcode" value="" style="cursor:pointer;height: 35px;width: 100px;"></div>
				</div>
			</div>
			<div class="col-xs-12 text-center" style="padding: 10px 0;margin: 20px 0;">
				<button class="btn btn-outlined">保存修改</button>
				<input type="hidden" id="membermobile" name="membermobile"  value="${membermobile}" />
			</div>
		</div>
	</section>
	<script type="text/javascript">
		$(function(){
			//获取短信验证码
            $('#getcode').click(function () {
                var _mobile = $("#membermobile").val();
                if(_mobile==""){
                	altTip("发送短信失败！请刷新重试。", 'error', function () {});
                	return;
                }
                $.post('${ROOT_PATH }UCenter/index/getmobilecode', {mobile: _mobile}, function (o) {
                    updateEndTime(120);
                    /*if (o) {
                    } else {
                        altTip('短信发送失败,请重新获取', 'error', function () {
                        	realname.focus();
                        });
                    }*/
                    return false;
                }, 'json');
            });
			$("button").click(function(){
				var pwd=$("#pwd");
                if (pwd.val() == "") {
                	pwd.focus();
                	altTip("请输入旧密码！", 'warning', function(){});
                   	return false;
                }
                var npwd=$("#npwd");
                if (pwd.val() != npwd.val()) {
                	npwd.val("");
                	npwd.focus();
                	altTip("新旧密码不一致！", 'warning', function(){});
                   	return false;
                }
                var checkcode = $('#checkcode');
                if (checkcode.val() == '') {
                    checkcode.focus();
                	altTip("请输入手机收到的验证码！", 'warning', function(){});
                    return false;
                }
                var params = {cardno:'${cardno}', password:$("#npwd").val(), checkcode:checkcode.val()};
                $.post('${ROOT_PATH }UCenter/changePwd', params, function (data){
                	if(data=="1"){
                		altTip("密码修改成功！", 'succeed', function(){});
                	}else if(data=="0"){
                		altTip("验证码不正确！请重新输入。", 'error', function(){});
                	}else{
                		altTip("密码修改失败！请重试。", 'error', function(){});
                	}
                });
			});
		});
		function updateEndTime(validate) {
            validate = validate - 1;
            if (validate > 0) {
                $('#getcode').attr('disabled', true).val(validate + 'S');
                setTimeout('updateEndTime(' + validate + ')', 1000);
            } else {
                $('#getcode').attr('disabled', false).val('');
            }
        }
	</script>
</body>
</html>